<template>
  <div class="container">
     <p>{{str}}</p>
    <input type="text" v-model="inp"><button @click="chuan()">传值</button><br/>
    <button @click="gai()">子修改</button>

  </div>
</template>

<script>
export default {
  data() {
    return {
      inp:''
    }
  },
  props: ['str'],
  methods:{
    gai(){
     this.$parent.str=121212121
    },
    chuan(){
      this.$emit('myson',this.inp)
    }
  },
}
</script>